<?php

require_once(dirname(__FILE__) . '/appconf.php');

class Clear_kvcache extends Site {

    function setup() {
        $this->run_modes('clear','c');
        $this->start_mode('clear');
        $this->selfurl = '/clear.php';
        parent::setup();
        include("common.php");
    }

    function cgiapp_prerun($rm = '') {
        parent::cgiapp_prerun();
    }


    function action_clear() {
        $kvcs = array();
		$kvcs['index'][0]['name'] = 'index_list';
		$kvcs['index'][0]['describe'] = '首頁最新邀請、提交報告、最新報告、flash';
		
		$kvcs['help'][0]['name'] = 'help_show';
		$kvcs['help'][0]['describe'] = '新手教學';
		
		$kvcs['search'][0]['name'] = 'search_procuct';
		$kvcs['search'][0]['describe'] = '產品搜索';
		$kvcs['search'][1]['name'] = 'search_event';
		$kvcs['search'][1]['describe'] = '產品搜索';
		$kvcs['search'][2]['name'] = 'search_member';
		$kvcs['search'][2]['describe'] = '會員搜索';
		
		$kvcs['event'][0]['name'] = 'event_invite_list';
		$kvcs['event'][0]['describe'] = '活動列表';
		$kvcs['event'][1]['name'] = 'event_invite_inpage';
		$kvcs['event'][1]['describe'] = '活動內頁';
		$kvcs['event'][2]['name'] = 'event_invite_page';
		$kvcs['event'][2]['describe'] = '活動內頁';
		$kvcs['event'][3]['name'] = 'event_invite_result';
		$kvcs['event'][3]['describe'] = '活動結果';
		$kvcs['event'][4]['name'] = 'eventbyid';
		$kvcs['event'][4]['describe'] = '活動內容';
		
		$kvcs['block'][0]['name'] = 'block_b3_1';
		$kvcs['block'][0]['describe'] = '搜索ajax';
		$kvcs['block'][1]['name'] = 'block_b4';
		$kvcs['block'][1]['describe'] = '體驗活動、工作坊';
		$kvcs['block'][2]['name'] = 'block_b5';
		$kvcs['block'][2]['describe'] = '人氣排行榜3';
		$kvcs['block'][14]['name'] = 'block_b5_1';
		$kvcs['block'][14]['describe'] = '人氣排行榜5';
		$kvcs['block'][3]['name'] = 'action_b7';
		$kvcs['block'][3]['describe'] = '特選報告';
		$kvcs['block'][4]['name'] = 'block_b8';
		$kvcs['block'][4]['describe'] = 'imore 最新資訊';
		$kvcs['block'][5]['name'] = 'block_b9';
		$kvcs['block'][5]['describe'] = '試用申請三步驟';
		$kvcs['block'][6]['name'] = 'block_b11';
		$kvcs['block'][6]['describe'] = '最新試用邀請';
		$kvcs['block'][7]['name'] = 'block_b12';
		$kvcs['block'][7]['describe'] = '其他報告';
		$kvcs['block'][8]['name'] = 'block_b14';
		$kvcs['block'][8]['describe'] = '評論試用報告';
		$kvcs['block'][9]['name'] = 'block_b15';
		$kvcs['block'][9]['describe'] = '最新體驗邀請';
		$kvcs['block'][10]['name'] = 'block_b16';
		$kvcs['block'][10]['describe'] = '個人頁面報告';
		$kvcs['block'][11]['name'] = 'block_b17';
		$kvcs['block'][11]['describe'] = '星級會員最新報告';
		$kvcs['block'][12]['name'] = 'block_b18';
		$kvcs['block'][12]['describe'] = '首頁搜索';
		$kvcs['block'][13]['name'] = 'block_b19';
		$kvcs['block'][13]['describe'] = 'F&B';
		
		$kvcs['person'][0]['name'] = 'person_get';
		$kvcs['person'][0]['describe'] = '用戶內容';
		$kvcs['person'][1]['name'] = 'person_report';
		$kvcs['person'][1]['describe'] = '用戶報告';
		$kvcs['person'][2]['name'] = 'person_blog';
		$kvcs['person'][2]['describe'] = '用戶blog';
		$kvcs['person'][3]['name'] = 'person_attention';
		$kvcs['person'][3]['describe'] = '用戶關注';
		$kvcs['person'][4]['name'] = 'person_recommen';
		$kvcs['person'][4]['describe'] = '用戶推薦';
		
		$kvcs['member_center'][0]['name'] = 'mc_blog_add';
		$kvcs['member_center'][0]['describe'] = '填寫blog';
		
		$kvcs['fg'][0]['name'] = 'fg_show';
		$kvcs['fg'][0]['describe'] = 'fg市調報告';
		$kvcs['fg'][1]['name'] = 'fg_list';
		$kvcs['fg'][1]['describe'] = 'fg產品報告列表';
		$kvcs['fg'][2]['name'] = 'fg_hot';
		$kvcs['fg'][2]['describe'] = 'fg熱門精選';
		$kvcs['fg'][3]['name'] = 'fg_detail';
		$kvcs['fg'][3]['describe'] = 'fg精選文章詳細';
		
		$kvcs['product'][0]['name'] = 'product_invite_list';
		$kvcs['product'][0]['describe'] = '邀請列表';
		$kvcs['product'][1]['name'] = 'product_campaign_list';
		$kvcs['product'][1]['describe'] = '活動campaign列表';
		$kvcs['product'][2]['name'] = 'product_submitReport_list';
		$kvcs['product'][2]['describe'] = '提交報告列表';
		$kvcs['product'][3]['name'] = 'product_submit_application';
		$kvcs['product'][3]['describe'] = '申請試用體驗';
		$kvcs['product'][4]['name'] = 'product_invite_inpage';
		$kvcs['product'][4]['describe'] = '邀請內頁';
		$kvcs['product'][5]['name'] = 'product_report_inpage';
		$kvcs['product'][5]['describe'] = '提交報告內頁';
		$kvcs['product'][6]['name'] = 'get_product_info';
		$kvcs['product'][6]['describe'] = '產品內容info';
		$kvcs['product'][7]['name'] = 'product_detail';
		$kvcs['product'][7]['describe'] = '產品詳情';
		$kvcs['product'][8]['name'] = 'get_product_byid';
		$kvcs['product'][8]['describe'] = '產品內容';
		$kvcs['product'][9]['name'] = 'product_reportDetail';
		$kvcs['product'][9]['describe'] = '报告内页';
		$kvcs['product'][10]['name'] = 'product_readReport_list';
		$kvcs['product'][10]['describe'] = '報告列表';
		$kvcs['product'][11]['name'] = 'product_report_add';
		$kvcs['product'][11]['describe'] = '提交報告';
		$kvcs['product'][12]['name'] = 'product_ajax';
		$kvcs['product'][12]['describe'] = '產品ajax,更多留言';
		$kvcs['product'][13]['name'] = 'product_emailApplication';
		$kvcs['product'][13]['describe'] = '發送email';
		$kvcs['product'][14]['name'] = 'product_report_edit';
		$kvcs['product'][14]['describe'] = '編輯報告';
		$kvcs['product'][15]['name'] = 'product_star_new';
		$kvcs['product'][15]['describe'] = '星級用戶';
		$kvcs['product'][16]['name'] = 'product_fg';
		$kvcs['product'][16]['describe'] = 'fg報告內頁';
                
                
		$kvcs['mapi'][17]['name'] = 'mapi_product_list';
		$kvcs['mapi'][17]['describe'] = '手機api產品列表';
		$kvcs['mapi'][18]['name'] = 'mapi_report_list';
		$kvcs['mapi'][18]['describe'] = '手機api報告列表';
		$kvcs['mapi'][19]['name'] = 'mapi_category_list';
		$kvcs['mapi'][19]['describe'] = '手機api分類列表';
		$kvcs['mapi'][20]['name'] = 'mapi_product_by_id';
		$kvcs['mapi'][20]['describe'] = '手機api單個產品';
		$kvcs['mapi'][21]['name'] = 'mapi_productApplication_list';
		$kvcs['mapi'][21]['describe'] = '手機api產品申請列表';
		$kvcs['mapi'][22]['name'] = 'mapi_reportsComment_list';
		$kvcs['mapi'][22]['describe'] = '手機api留言列表';
		
		$_return = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><h3>clear kvcache</h3><hr/>';
		foreach($kvcs as $k=>$v){
			$_return .= "<ul><li>" . $k . "</li><li><ul>";
			foreach($v as $k1=>$v1){
				$_return .= "<li><a href=\"/clear_kvcache.php?action=c&kvc=" . $v1['name'] . "\">" . $v1['describe'] . " - " . $v1['name'] . "</a></li>";
			}
			$_return .= "</ul></li></ul>";
		}
		echo $_return;
        
    }
	
	function action_c(){
        $kvc = trim($this->get_q('kvc', ''));
		clear_kvcache($kvc);
	}

}

$webapp = new Clear_kvcache();
$webapp->run();
?>